﻿@namespace BlazorComponent
@inherits BDomComponentBase
@typeparam TColumnItem

<div class="@CssProvider.GetClass("column")" style="@CssProvider.GetStyle("column")"
     @ontouchstart="OnTouchstart"
     @ontouchmove="OnTouchmove"
     @ontouchend="OnTouchend"
     @ontouchcancel="OnTouchend">
    <ul class="@CssProvider.GetClass("column-wrapper")" style="@CssProvider.GetStyle("column-wrapper")"
        @ontransitionend="OnTransitionEnd"
        @ref="Wrapper">

        @foreach (var (item, index) in Items.Select((item, index) => (item, index)))
        {
            <li class="@CssProvider.GetClass("column-item", data: ItemDisabled?.Invoke(item) is true)"
                style="@CssProvider.GetStyle("column-item")"
                @onclick="@(() => OnClickItem(index))">
                <div class="@CssProvider.GetClass("column-text")">@ItemText?.Invoke(item)</div>
            </li>
        }
    </ul>
</div>
